package cn.iocoder.yudao.module.kt.dal.mysql.ketang;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.kt.dal.dataobject.ketang.KetangDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.kt.controller.admin.ketang.vo.*;

/**
 * 数字人课堂 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface KetangMapper extends BaseMapperX<KetangDO> {

    default PageResult<KetangDO> selectPage(KetangPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KetangDO>()
                .likeIfPresent(KetangDO::getName, reqVO.getName())
                .eqIfPresent(KetangDO::getNum, reqVO.getNum())
                .eqIfPresent(KetangDO::getSession, reqVO.getSession())
                .eqIfPresent(KetangDO::getPicBg, reqVO.getPicBg())
                .betweenIfPresent(KetangDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(KetangDO::getKtStudyFileId, reqVO.getKtStudyFileId())
                .eqIfPresent(KetangDO::getMindMapId, reqVO.getMindMapId())
                .eqIfPresent(KetangDO::getStatus, reqVO.getStatus())
                .orderByDesc(KetangDO::getId));
    }

}